package creation.abstractFactory;

interface AbFactory {
    Pizza createPizza(String name);
}

class BJFactory implements AbFactory {

    @Override
    public Pizza createPizza(String name) {
        Pizza pizza = null;
        switch (name){
            case "chess":
                pizza = new BJChessPizza();
                break;
            case "greek":
                pizza = new BJGreekPizza();
                break;
        }
        return pizza;
    }
}
class LDFactory implements AbFactory {

    @Override
    public Pizza createPizza(String name) {
        Pizza pizza = null;
        switch (name){
            case "chess":
                pizza = new LDChessPizza();
                break;
            case "greek":
                pizza = new LDGreekPizza();
                break;
        }
        return pizza;
    }
}